package Animalmanagement;

import java.util.ArrayList;

import Animal.Baboon;
import Animal.Bear;
import Animal.Crocodile;
import Animal.Crow;
import Animal.Elephant;
import Animal.Frog;
import Animal.Furseal;
import Animal.Gibbon;
import Animal.Giraffe;
import Animal.Gorilla;
import Animal.Horse;
import Animal.Iguana;
import Animal.Impala;
import Animal.Kangaroo;
import Animal.Koala;
import Animal.Leopard;
import Animal.Lion;
import Animal.Mole;
import Animal.Orangutan;
import Animal.Ostrich;
import Animal.Peacock;
import Animal.Pelican;
import Animal.Penguin;
import Animal.SquirrelMonkey;
import Animal.Stork;
import Animal.Tiger;
import Animal.Turtle;
import Animal.WildBoar;

public class AnimalManagement {

	public ArrayList<Animal> AnimalList = new ArrayList<Animal>();
	private static AnimalManagement animalmanagement;

	public static AnimalManagement getInstance() {
		animalmanagement = new AnimalManagement();
		return animalmanagement;
	}

	Animal bear = new Bear("bear", "forest", "polyphagia", "110~280cm");
	Animal baboon = new Baboon("baboon", "forest", "polyphagia", "70~140cm");
	Animal crocodile = new Crocodile("crocodile", "marshy land and Lake",
			"carnivores", "100~900cm");
	Animal crow = new Crow("crow", "forest or farmland", "polyphagia",
			"100~115cm");
	Animal elephant = new Elephant("elephant", "savanna", "herbivores", "640cm");
	Animal frog = new Frog("frog", "waterside", "carnivores", "4~38cm");
	Animal furseal = new Furseal("furseal", "seaside", "carnivores",
			"130~250cm");
	Animal gibbon = new Gibbon("gibbon", "tropical rain forest", "polyphagia",
			"60~76cm");
	Animal giraffe = new Giraffe("giraffe", "forest", "hebivores", "350~480cm");
	Animal gorilla = new Gorilla("gorilla", "tropical rain forest",
			"herbivores", "125~175cm");
	Animal horse = new Horse("horse", "grassland", "hebivores", "200cm");
	Animal iguana = new Iguana("iguana", "riverside or lake", "polyphagia",
			"175~200cm");
	Animal impala = new Impala("impala", "savanna", "herbivores", "110~150cm");
	Animal kangaroo = new Kangaroo("kangaroo", "grassland", "herbivores",
			"150cm");
	Animal koala = new Koala("koala", "Eucalyptus Forest", "herbivores",
			"60~80cm");
	Animal leopard = new Leopard("leopard", "Riverside Forest or Savanna",
			"carnivores", "120~180cm");
	Animal lion = new Lion("lion", "savanna or grassland", "carnivores",
			"165~250cm");
	Animal mole = new Mole("mole", "Under the ground", "polyphagia", "14~16cm");
	Animal orangutan = new Orangutan("orangutan", "Forest or Marsh",
			"herbivores", "120~150cm");
	Animal ostrich = new Ostrich("ostrich", "grassland", "polyphagia", "240cm");
	Animal peacock = new Peacock("peacock", "Forest or Waterside",
			"polyphagia", "110cm");
	Animal pelican = new Pelican("pelican", "Seaside or Lake", "polyphagia",
			"140~178cm");
	Animal wildboar = new WildBoar("wildboar", "deep mountain", "polyphagia",
			"1.1~1.8m");
	Animal penguin = new Penguin("penguin", "seaside", "polyphagia", "40~90cm");
	Animal squirrelmonkey = new SquirrelMonkey("Squirrel Monkey", "forest",
			"herbivores", "27.5~37cm");
	Animal stork = new Stork("stork", "riverside", "polyphagia", "100~115cm");
	Animal tiger = new Tiger("tiger", "bush or forest", "carnivores",
			"180~400cm");
	Animal turtle = new Turtle("turtle", "marshy land", "carnivores", "5~120cm");

	private AnimalManagement() {
		AnimalList.add(ostrich);
		AnimalList.add(crow);
		AnimalList.add(stork);
		AnimalList.add(peacock);
		AnimalList.add(pelican);
		AnimalList.add(penguin);
		AnimalList.add(kangaroo);
		AnimalList.add(impala);
		AnimalList.add(koala);
		AnimalList.add(elephant);
		AnimalList.add(horse);
		AnimalList.add(giraffe);
		AnimalList.add(lion);
		AnimalList.add(leopard);
		AnimalList.add(wildboar);
		AnimalList.add(bear);
		AnimalList.add(tiger);
		AnimalList.add(gorilla);
		AnimalList.add(gibbon);
		AnimalList.add(baboon);
		AnimalList.add(orangutan);
		AnimalList.add(furseal);
		AnimalList.add(squirrelmonkey);
		AnimalList.add(mole);
		AnimalList.add(iguana);
		AnimalList.add(frog);
		AnimalList.add(turtle);
		AnimalList.add(crocodile);
	}

	public ArrayList<Animal> returnList() {
		return AnimalList;
	}

	public Animal SearchingAnimal(String sa) {
		int i = 0;
		Animal rsa;

		for (i = 0; i < AnimalList.size(); i++) {
			if (sa == (AnimalList.get(i).getName())) {
				rsa = AnimalList.get(i);

				return rsa;
			}
		}
		return null;
	}
}
